package com.chongbangbang.service.impl;

import com.chongbangbang.mapper.UserInfoMapper;
import com.chongbangbang.pojo.UserInfo;
import com.chongbangbang.service.WXService;
import com.chongbangbang.util.FileUploadUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author TP
 * @version 1.0
 * @date 2022/8/28/0028 15:56
 */
@Service
public class WXServiceImpl implements WXService {

    @Autowired
    private UserInfoMapper userInfoMapper;

    /**
    根据openId获取userId
    */
    @Override
    public UserInfo getUserByOpenId(String openId) {
        return userInfoMapper.getUserByOpenId(openId);
    }

    @Override
    public String upload(MultipartFile file, String openid) {

        return FileUploadUtil.upload(file, openid);
    }
}
